﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cmsservice.Entity
{
    public class CompanyIPOModel
    {
        #region Model
        private string _orgid;
        /// <summary>
        /// 主键
        /// </summary>
        public string OrgID
        {
            get { return _orgid; }
            set { _orgid = value; }
        }
        private string _secucategory;
        /// <summary>
        /// 证券类别
        /// </summary>
        public string SecuCategory
        {
            get { return _secucategory; }
            set { _secucategory = value; }
        }
        private decimal? _totalissuevol;
        private decimal? _publicissuevol;
        private decimal? _stateshreducedvol;
        private decimal? _tailoredplvol;
        private decimal? _tailoredstaffvol;
        private decimal? _otherallotvol;
        private decimal? _parvalue;
        /// <summary>
        /// 发行面值（元）
        /// </summary>
        public decimal? ParValue
        {
            get { return _parvalue; }
            set { _parvalue = value; }
        }
        private string _secucode;
        /// <summary>
        /// 股票代码
        /// </summary>
        public string SecuCode
        {
            set { _secucode = value; }
            get { return _secucode; }
        }
        private string _secuabbr;
        /// <summary>
        /// 股票名称
        /// </summary>
        public string SecuAbbr
        {
            set { _secuabbr = value; }
            get { return _secuabbr; }
        }

        private decimal? _issuepricermb;
        /// <summary>
        /// 发行价格
        /// </summary>
        public decimal? IssuePriceRMB
        {
            get { return _issuepricermb; }
            set { _issuepricermb = value; }
        }
        private decimal? _issuepricefc;
        private string _foreigncurrency;
        private decimal? _weightedpe;
        private decimal? _dilutedpe;
        /// <summary>
        /// 发行市盈率
        /// </summary>
        public decimal? DilutedPE
        {
            get { return _dilutedpe; }
            set { _dilutedpe = value; }
        }
        private string _SSTJRName;
        /// <summary>
        /// 上市推荐人
        /// </summary>
        public string SSTJRName
        {
            get { return _SSTJRName; }
            set { _SSTJRName = value; }
        }
        private string _ZCXSName;
        /// <summary>
        /// 主承销商
        /// </summary>
        public string ZCXSName
        {
            get { return _ZCXSName; }
            set { _ZCXSName = value; }
        }
        private string _FZCXSName;
        /// <summary>
        /// 副主承销商
        /// </summary>
        public string FZCXSName
        {
            get { return _FZCXSName; }
            set { _FZCXSName = value; }
        }
        private decimal? _napsbefore;
        /// <summary>
        /// 发行前每股净资产（元）
        /// </summary>
        public decimal? NAPSBefore
        {
            get { return _napsbefore; }
            set { _napsbefore = value; }
        }
        private decimal? _napsafter;
        /// <summary>
        /// 发行后每股净资产（元）
        /// </summary>
        public decimal? NAPSAfter
        {
            get { return _napsafter; }
            set { _napsafter = value; }
        }
        private string _pricingmodel;
        private decimal? _inquirypriceceiling;
        private decimal? _inquirypricefloor;
        private string _issueobject;
        private string _issuemethodcode;
        private string _issuemethod;
        private string _underwritemode;
        /// <summary>
        /// 承销方式
        /// </summary>
        public string UnderwriteMode
        {
            get
            {
                if (_underwritemode == "051001")
                    return "包销";
                else if (_underwritemode == "051002")
                    return "代销";
                else
                    return "余额包销";
            }
            set { _underwritemode = value; }
        }
        private string _issuearea;
        private string _issueareacode;
        private string _initiator;
        private string _orgintro;
        /// <summary>
        /// 公司简介
        /// </summary>
        public string OrgIntro
        {
            get { return _orgintro; }
            set { _orgintro = value; }
        }
        private string _businessmajor;
        /// <summary>
        /// 主营业务
        /// </summary>
        public string BusinessMajor
        {
            get { return _businessmajor; }
            set { _businessmajor = value; }
        }
        private string _distributecommit;
        /// <summary>
        /// 股利分配政策/分配承诺
        /// </summary>
        public string DistributeCommit
        {
            get { return _distributecommit; }
            set { _distributecommit = value; }
        }
        private decimal? _openprice;
        /// <summary>
        /// 首日开盘价（元）
        /// </summary>
        public decimal? OpenPrice
        {
            get { return _openprice; }
            set { _openprice = value; }
        }
        private decimal? _ChangeRatio;
        /// <summary>
        /// 首日涨幅（%）
        /// </summary>
        public decimal? ChangeRatio
        {
            get { return _ChangeRatio; }
            set { _ChangeRatio = value; }
        }
        private decimal? _TurnoverRate;
        /// <summary>
        /// 首日换手率（%）
        /// </summary>
        public decimal? TurnoverRate
        {
            get { return _TurnoverRate; }
            set { _TurnoverRate = value; }
        }
        private decimal? _estiproceeds;
        private decimal? _actualproceeds;
        /// <summary>
        /// 实际募集资金总额（亿元）
        /// </summary>
        public decimal? ActualProceeds
        {
            get { return _actualproceeds; }
            set { _actualproceeds = value; }
        }
        private decimal? _netproceedsrmb;
        private decimal? _netproceedsfc;
        private decimal? _issuecost;
        private decimal? _underwritefee;
        private decimal? _issuecostpsh;

        private string _ZQH;
        /// <summary>
        /// 中签号
        /// </summary>
        public string ZQH
        {
            get { return _ZQH; }
            set { _ZQH = value; }
        }
        private DateTime? _prospectuspubldate;

        /// <summary>
        /// 招股公告日期
        /// </summary>
        public DateTime? ProspectusPublDate
        {
            get { return _prospectuspubldate; }
            set { _prospectuspubldate = value; }
        }
        /// <summary>
        /// 招股公告日期
        /// </summary>
        public string ZGGGRQRQ
        {
            get
            {
                if (_prospectuspubldate != null)
                {
                    string dt = ((DateTime)_prospectuspubldate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _mvbasedate;
        private DateTime? _olissuedate;
        /// <summary>
        /// 申购日期/网上发行日期
        /// </summary>
        public DateTime? OLIssueDate
        {
            get { return _olissuedate; }
            set { _olissuedate = value; }
        }
        /// <summary>
        /// 申购日期/网上发行日期
        /// </summary>
        public string SGRQ
        {
            get
            {
                if (_olissuedate != null)
                {
                    string dt = ((DateTime)_olissuedate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }

        private DateTime? _smallotdate;
        private DateTime? _offlallotstartdate;
        /// <summary>
        /// 网下配售起始日
        /// </summary>
        public DateTime? OffLAllotStartDate
        {
            get { return _offlallotstartdate; }
            set { _offlallotstartdate = value; }
        }
        /// <summary>
        /// 网下配售起始日
        /// </summary>
        public string WXPSQSRQ
        {
            get
            {
                if (_offlallotstartdate != null)
                {
                    string dt = ((DateTime)_offlallotstartdate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }

        private DateTime? _jjdate;
        /// <summary>
        /// 网下申购解禁日
        /// </summary>
        public DateTime? JJdate
        {
            get { return _jjdate; }
            set { _jjdate = value; }
        }

        private DateTime? _offlallotenddate;
        /// <summary>
        /// 网下配售日期/网下配售截止日
        /// </summary>
        public DateTime? OffLAllotEndDate
        {
            get { return _offlallotenddate; }
            set { _offlallotenddate = value; }
        }
        /// <summary>
        /// 网下配售日期/网下配售截止日
        /// </summary>
        public string WXPSRQ
        {
            get
            {
                if (_offlallotenddate != null)
                {
                    string dt = ((DateTime)_offlallotenddate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _otherissuedate;
        private string _secumarket;
        /// <summary>
        /// 上市地点
        /// </summary>
        public string SecuMarket
        {
            get
            {
                if (_secumarket == "012001")
                    return "上海证券交易所";
                else
                    return "深圳证券交易所";
            }
            set { _secumarket = value; }
        }
        private string _olapplycode;
        /// <summary>
        /// 申购代码
        /// </summary>
        public string OLApplyCode
        {
            get { return _olapplycode; }
            set { _olapplycode = value; }
        }
        private string _olapplynameabbr;
        private string _applycodesm;
        private string _applynameabbrsm;
        private string _blockcode;
        /// <summary>
        /// 所属板块代码
        /// </summary>
        public string BlockCode
        {
            get { return _blockcode; }
            set { _blockcode = value; }
        }

        private string _blockname;
        /// <summary>
        /// 所属板块名称
        /// </summary>
        public string BlockName
        {
            set { _blockname = value; }
            get { return _blockname; }
        }
        private decimal? _olissuevol;
        /// <summary>
        /// 网上发行（股）
        /// </summary>
        public decimal? OLIssueVol
        {
            get { return _olissuevol; }
            set { _olissuevol = value; }
        }
        /// <summary>
        /// 冻结资金（亿元）
        /// </summary>
        public decimal? DJZJ
        {
            get
            {
                if (_olapplymoney == null)
                    _olapplymoney = 0;
                if (_offlapplymoney == null)
                    _offlapplymoney = 0;
                return (_olapplymoney + _offlapplymoney);
            }
        }
        private decimal? _smallotvol;
        private decimal? _offlallotvol;
        /// <summary>
        /// 网下配售股数（股）
        /// </summary>
        public decimal? OffLAllotVol
        {
            get { return _offlallotvol; }
            set { _offlallotvol = value; }
        }
        private decimal? _clawbackvol;
        private string _clawbackmodecode;
        private string _clawbackmode;
        private decimal? _underwritebalance;

        private decimal? _ollotrate;
        /// <summary>
        /// 中签率（%）
        /// </summary>
        public decimal? OLLotRate
        {
            get { return _ollotrate; }
            set { _ollotrate = value; }
        }
        /// <summary>
        /// 每中一签（万元）
        /// </summary>
        public decimal? MZYQ
        {
            get
            {
                if (_olapplymoney == null)
                    _olapplymoney = 0;
                if (_olissuevol == null)
                    _olissuevol = 0;
                //沪市：=OLApplyMoney/(OLIssueVol/1000)；
                //深市：=OLApplyMoney/(OLIssueVol/500)
                if (_olissuevol != 0)
                {
                    if (_secucategory == "沪市")
                        return 10000 * _olapplymoney / (_olissuevol / 1000);
                    else
                        return 10000 * _olapplymoney / (_olissuevol / 500);
                }
                else
                    return 0;
            }
        }
        private decimal? _smlotrate;
        private decimal? _offllotrate;
        /// <summary>
        /// 网下配售中签率
        /// </summary>
        public decimal? OffLLotRate
        {
            get { return _offllotrate; }
            set { _offllotrate = value; }
        }
        private decimal? _oversubstimes;
        private decimal? _olvalidapplyvol;
        private decimal? _olvalidapplynum;
        private decimal? _olapplymoney;
        /// <summary>
        /// 网上有效申购资金
        /// </summary>
        public decimal? OLApplyMoney
        {
            get { return _olapplymoney; }
            set { _olapplymoney = value; }
        }
        private decimal? _smvalidapplyvol;
        private decimal? _smvalidapplynum;
        private decimal? _smapplymoney;
        private decimal? _offlvalidapplyvol;
        private decimal? _offlvalidapplynum;
        private decimal? _offlapplymoney;
        /// <summary>
        /// 网下有效申购资金
        /// </summary>
        public decimal? OffLApplyMoney
        {
            get { return _offlapplymoney; }
            set { _offlapplymoney = value; }
        }
        private decimal? _lpvalidapplyvol;
        private decimal? _lpallotvol;
        private decimal? _lpallotnum;
        private decimal? _strvalidapplyvol;
        private decimal? _strallotvol;
        private decimal? _strallotnum;
        private decimal? _fundvalidapplyvol;
        private decimal? _fundallotvol;
        private decimal? _fundallotnum;
        private DateTime? _listpubldate;
        /// <summary>
        /// 上市公告日期
        /// </summary>
        public DateTime? ListPublDate
        {
            get { return _listpubldate; }
            set { _listpubldate = value; }
        }
        /// <summary>
        /// 上市公告日期
        /// </summary>
        public string SSGBRQ
        {
            get
            {
                if (_listpubldate != null)
                {
                    string dt = ((DateTime)_listpubldate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _moneytoaccount;
        private decimal? _strlockperiod;
        private string _ifaccumuinquiry;
        private DateTime? _promotionstartdate;
        /// <summary>
        /// 现场推介起始日
        /// </summary>
        public DateTime? PromotionStartDate
        {
            get { return _promotionstartdate; }
            set { _promotionstartdate = value; }
        }
        /// <summary>
        /// 现场推介起始日
        /// </summary>
        public string XCTJQSRQ
        {
            get
            {
                if (_promotionstartdate != null)
                {
                    string dt = ((DateTime)_promotionstartdate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _promotionenddate;
        /// <summary>
        /// 现场推介截止日
        /// </summary>
        public DateTime? PromotionEndDate
        {
            get { return _promotionenddate; }
            set { _promotionenddate = value; }
        }
        /// <summary>
        /// 现场推介截止日
        /// </summary>
        public string XCTJJZRQ
        {
            get
            {
                if (_promotionenddate != null)
                {
                    string dt = ((DateTime)_promotionenddate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _olroadshowstartdate;
        /// <summary>
        /// 网上路演起始日
        /// </summary>
        public DateTime? OLRoadShowStartDate
        {
            get { return _olroadshowstartdate; }
            set { _olroadshowstartdate = value; }
        }
        /// <summary>
        /// 网上路演起始日
        /// </summary>
        public string WLSYQSRQ
        {
            get
            {
                if (_olroadshowstartdate != null)
                {
                    string dt = ((DateTime)_olroadshowstartdate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private string _applypricerange;
        private DateTime? _preinquirystartdate;
        /// <summary>
        /// 初步询价开始日期
        /// </summary>
        public DateTime? PreInquiryStartDate
        {
            get { return _preinquirystartdate; }
            set { _preinquirystartdate = value; }
        }
        /// <summary>
        /// 初步询价开始日期
        /// </summary>
        public string CBXJKSRQ
        {
            get
            {
                if (_preinquirystartdate != null)
                {
                    string dt = ((DateTime)_preinquirystartdate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _preinquiryenddate;
        /// <summary>
        /// 初步询价截止日期
        /// </summary>
        public DateTime? PreInquiryEndDate
        {
            get { return _preinquiryenddate; }
            set { _preinquiryenddate = value; }
        }
        /// <summary>
        /// 初步询价截止日期
        /// </summary>
        public string CBXJJZRQ
        {
            get
            {
                if (_preinquiryenddate != null)
                {
                    string dt = ((DateTime)_preinquiryenddate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _pricerangepubldate;
        private DateTime? _offlrefunddate;
        /// <summary>
        /// 网下冻结资金返回日期
        /// </summary>
        public DateTime? OffLRefundDate
        {
            get { return _offlrefunddate; }
            set { _offlrefunddate = value; }
        }
        /// <summary>
        /// 网下冻结资金返回日期
        /// </summary>
        public string WXDJZJFHRQ
        {
            get
            {
                if (_offlrefunddate != null)
                {
                    string dt = ((DateTime)_offlrefunddate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _olrefunddate;
        /// <summary>
        /// 网上冻结资金返回日期
        /// </summary>
        public DateTime? OLRefundDate
        {
            get { return _olrefunddate; }
            set { _olrefunddate = value; }
        }
        /// <summary>
        /// 网上冻结资金返回日期
        /// </summary>
        public string WSDJZJFHRQ
        {
            get
            {
                if (_olrefunddate != null)
                {
                    string dt = ((DateTime)_olrefunddate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private DateTime? _pricepubldate;
        /// <summary>
        /// 定价公告日期
        /// </summary>
        public DateTime? PricePublDate
        {
            get { return _pricepubldate; }
            set { _pricepubldate = value; }
        }
        /// <summary>
        /// 定价公告日期
        /// </summary>
        public string DJGGRQ
        {
            get
            {
                if (_pricepubldate != null)
                {
                    string dt = ((DateTime)_pricepubldate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private decimal? _offllockperiod;
        private decimal? _plannedissuevol;
        private decimal? _olplannedissuepct;
        private decimal? _offlplannedissuepct;
        private decimal? _olapplymax;
        /// <summary>
        /// 申购数量上限（股）
        /// </summary>
        public decimal? OLApplyMax
        {
            get { return _olapplymax; }
            set { _olapplymax = value; }
        }
        private decimal? _olapplyfloor;
        private decimal? _offlapplymax;
        private decimal? _offlapplyfloor;
        private decimal? _offlapplyunit;
        private decimal? _olapplyunit;
        private DateTime? _offlapplyenddate;
        private string _intentletterwebsite;
        private decimal? _olplannedissuevol;
        private decimal? _offlplannedissuevol;
        private decimal? _offloversubstimes;
        private decimal? _strissuepct;
        private DateTime? _lotresultpubldate;
        private DateTime? _listeddate;
        /// <summary>
        /// 上市日期
        /// </summary>
        public DateTime? ListedDate
        {
            get { return _listeddate; }
            set { _listeddate = value; }
        }
        /// <summary>
        /// 上市日期
        /// </summary>
        public string SSRQ
        {
            get
            {
                if (_listeddate != null)
                {
                    string dt = ((DateTime)_listeddate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }

        /// <summary>
        /// 中签号公布日/摇号结果公告日
        /// </summary>
        public DateTime? LotResultPublDate
        {
            get { return _lotresultpubldate; }
            set { _lotresultpubldate = value; }
        }
        /// <summary>
        /// 中签号公布日/摇号结果公告日
        /// </summary>
        public string ZQHGBRQ
        {
            get
            {
                if (_lotresultpubldate != null)
                {
                    string dt = ((DateTime)_lotresultpubldate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }

        private DateTime? _lotratepubldate;
        /// <summary>
        /// 中签率公告日
        /// </summary>
        public DateTime? LotRatePublDate
        {
            get { return _lotratepubldate; }
            set { _lotratepubldate = value; }
        }
        /// <summary>
        /// 中签率公告日
        /// </summary>
        public string ZQLGGRQ
        {
            get
            {
                if (_lotratepubldate != null)
                {
                    string dt = ((DateTime)_lotratepubldate).ToString("yyyy-MM-dd");
                    if (dt == "1900-01-01")
                    {
                        dt = "--";
                    }
                    return dt;
                }
                else
                {
                    return "--";
                }
            }
        }
        private string _ifgreenshoe;
        private decimal? _oversubsum;
        private string _memo;
        private DateTime? _rectime;
        private DateTime _modtime;
        private string _isvalid;
        private decimal? _recordid;
        /// <summary>
        /// 
        /// </summary>
        public decimal? RecordID
        {
            get { return _recordid; }
            set { _recordid = value; }
        }
        private Guid _jcguid;
        private decimal? _closeprice;

        /// <summary>
        /// 首日收盘价
        /// </summary>
        public decimal? ClosePrice
        {
            get { return _closeprice; }
            set { _closeprice = value; }
        }

        /// <summary>
        /// 总发行数量（股）
        /// </summary>
        public decimal? TotalIssueVol
        {
            set { _totalissuevol = value; }
            get { return _totalissuevol; }
        }

        /// <summary>
        /// 申购资金（万元）
        /// </summary>
        public decimal? SGZJ
        {
            get
            {
                if (_issuepricermb == null)
                    _issuepricermb = 0;
                if (_olapplymax == null)
                    _olapplymax = 0;
                return _issuepricermb * _olapplymax;
            }
        }
        #endregion Model
    }
}
